package com.atom.test.view

import android.graphics.BitmapFactory
import android.os.Bundle
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import com.otaliastudios.zoom.ZoomLayout

class ViewZoomLayoutActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_zoom_layout)
        val image = resources.assets.open("banner/liuyifei1.jpg")
        val zoomImageView = findViewById<ImageView>(R.id.imageView)
        val zoomLayout = findViewById<ZoomLayout>(R.id.zoomLayout)
        zoomLayout.setMinZoom(0.3f)
        zoomLayout.setMaxZoom(5f)
        //zoomLayout.realZoomTo( 0.5f , false)
        zoomImageView.setImageBitmap(BitmapFactory.decodeStream(image))
    }
}